package edu.zut.cs.software.perfect.attendance.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonIgnore;

import edu.zut.cs.software.perfect.base.domain.BaseEntity;

/**
 * 
 * @Title: CourseAttendance
 * @Description: TODO
 * @author: lipengde
 * @date 2020年5月25日 下午7:27:07
 */
@Entity
@Table(name = "T_COURSEATTENDANCE")
public class CourseAttendance extends BaseEntity<Long> {

	private static final long serialVersionUID = 2693342792526495007L;

	/**
	 * Attendance course Code(ID)
	 */
	@Column
	String courseCode;

	/**
	 * Attendance course Name
	 */
	@Column
	String CourseName;

	/**
	 * Attendance class ID
	 */
	@Column
	String classId;

	/**
	 * Student ID of attendance
	 */
	@Column
	String studentId;

	/**
	 * Student Name of attendance
	 */
	@Column
	String studentName;

	/**
	 * Whether the attendance
	 */
	@Column
	String whetherAttendance;

	/**
	 * attendance rate
	 */
	@Column
	String attendanceRate;
	/**
	 * Establish a one-to-many relationship between Course attendance and class
	 * attendance
	 */
	@ManyToOne
	@JoinColumn(name = "ATTENDANCE_CLERK_ID")
	@JsonIgnore
	AttendanceClerk attendanceClerk;

	public void setAttendanceClerk(AttendanceClerk attendanceClerk) {
		this.attendanceClerk = attendanceClerk;
	}

	public String getClassId() {
		return classId;
	}

	public void setClassId(String classId) {
		this.classId = classId;
	}

	public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	public String getStudentName() {
		return studentName;
	}

	public void setStudentName(String studentName) {
		this.studentName = studentName;
	}

	public String getCourseCode() {
		return courseCode;
	}

	public void setCourseCode(String courseCode) {
		this.courseCode = courseCode;
	}

	public String getWhetherAttendance() {
		return whetherAttendance;
	}

	public void setWhetherAttendance(String whetherAttendance) {
		this.whetherAttendance = whetherAttendance;
	}

	public String getCourseName() {
		return CourseName;
	}

	public void setCourseName(String courseName) {
		CourseName = courseName;
	}

	public String getAttendanceRate() {
		return attendanceRate;
	}

	public void setAttendanceRate(String attendanceRate) {
		this.attendanceRate = attendanceRate;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

}
